#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (int argc, char const* argv[])
{
    int idx, a[1024], i, j, t;
    char *p, buf[1024];

    while (scanf("%s", buf) != EOF) {
        a[0] = atoi(strtok(buf, "5"));
        idx = 1;
        while((p = strtok(NULL, "5"))) {
            a[idx++] = atoi(p);
        }

        for (i = 0; i < idx-1; i++) {
            for (j = i+1; j < idx; j++) {
                if (a[i] > a[j]) {
                    t = a[i]; a[i] = a[j]; a[j] = t;
                }
            }
        }

        printf("%d", a[0]);
        for (i = 1; i < idx; i++) {
            printf(" %d", a[i]);
        }
        printf("\n");
    }

    return 0;
}
